<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue.js</title>
    <link rel="stylesheet" href="style.css"/>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
<!--vue-app是根容器-->
<div id="vue-app">
    <h1> 实战demo </h1>
    <!--图片-->
    <div id="bag" v-bind:class="{burst:ended}" v-on:click="punch"></div>

    <!--进度情况-->
    <div id="bag-health">
        <div v-bind:style="{width:health+'%'}"></div>
    </div>

    <!--控制按钮-->
    <div id="controls">
        <button v-on:click="punch" v-show = "!ended">使劲敲</button>
        <button @click="restart">重新开始</button>
    </div>
</div>

<script src="app.js"></script>
</body>
</html>